<template>
    <!-- 榜单组件 -->
    <router-link :to="{path:'SongListDetail',query:{type:this.typeNumber}}" tag="div"
        class="songTopList">
        <div class="songListAll">
            <div class="imgLogo"> <img :src="billboard.pic_s192" alt=""></div>
            <ul class="songName">
                <li v-for="(item,index) in song_list " :key="index">
                    <span>{{index+1}}、</span>
                    {{item.title}}
                </li>
            </ul>
        </div>
    </router-link>
</template>

<script>
    import {
        getSongList
    } from '../api/api';
    export default {
        data() {
            return {
                billboard: [],
                song_list: [],
                songID: '',
                typeNumber: ''
            }
        },
        props: ['type', 'size'],
        created() {
            getSongList(this.type, this.size).then(res => {
                this.billboard = res.billboard;
                this.song_list = res.song_list;
                // console.log(this.song_list);
                // console.log(this.billboard);
                this.typeNumber = this.billboard.billboard_type;
                // console.log(this.typeNumber);
                this.songID = this.song_list[0].song_id;
            })
        }
    }
</script>

<style lang="less" scoped>
    .imgLogo {
        width: 100px;
        height: 100px;
        float: left;

        img {
            width: 100%;
            height: 100%;
        }


    }

    .songName {
        li {
            margin-left: 100px;
            width: calc(100% - 100px);
            padding-top: 10px;
            padding-left: 20px;

            span {
                font-size: 16px;
                color: red;
                font-weight: 600;
            }
        }
    }

    .songListAll {
        padding: 20px;
    }
</style>>